package com.vv.ossupload.service.impl;

import com.amazonaws.services.s3.AmazonS3;
import com.vv.ossupload.handler.AwsOssUploadHandler;
import com.vv.ossupload.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

/**
 * @author kw
 * @program upload-demo
 * @description
 * @create 2025 - 06 - 21 11:29
 **/
@Service
public class OssServiceImpl implements OssService {


    @Autowired
    private AwsOssUploadHandler awsUploadHandler;

    @Override
    public Map<String, String> uploadFile(MultipartFile file, String bucketName, String objectName) {
        awsUploadHandler.putObject(bucketName, objectName, file);
        return new HashMap<>();
    }

    @Override
    public Map<String, String> uploadFile(InputStream inputStream, String bucketName, String objectName) {
        return null;
    }

    @Override
    public boolean deleteFile(String bucketName, String objectName) {
        return false;
    }
}
